package com.hyh.shiyanshiguanli.mapper;

import com.hyh.shiyanshiguanli.domain.dto.StudentAddDTO;
import com.hyh.shiyanshiguanli.domain.dto.StudentUpdateDTO;
import com.hyh.shiyanshiguanli.domain.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author hyh
 * @version 1.0
 */
@Mapper
public interface StudentMapper {
    List<Student> page();

    @Insert("insert into student (image, name, student_id, username, password, phone, email) " +
            "values (#{image},#{name},#{studentId},#{username},#{password},#{phone},#{email})")
    void add(StudentAddDTO studentAddDTO);

    @Select("select * from student where id = #{id}")
    Student selectById(@Param("id") Integer id);

    void updateById(StudentUpdateDTO studentUpdateDTO);

    @Delete("delete from student where id = #{id}")
    void deleteById(@Param("id") Integer id);
}
